Skip to content
This repository was archived by the owner on Jun 3, 2024. It is now read-only.

Allow children in Checklist options #105

Closed
wants to merge 3 commits into from

Conversation

Akronix
Copy link
Contributor

@Akronix Akronix commented Oct 31, 2017

I'm developing a webapp which needs to have checkboxes that contain another (Dash's) React
component, so I've modified the Checklist component to allow to include options with children components, as well as a button to show/hide those children.

Here is a short "demo":
anim

This is a first approach, so take it as a prototype. We can work on it and improve it until it reaches a production-ready code and then we can squash all commits and merge with master.

@chriddyp
Copy link
Member

chriddyp commented Nov 2, 2017

Thanks @Akronix ! I think that this is out of the scope for this core checkbox component - I'd like to keep the options as simple possible and this feels like a more specialized UI that would be better suited in a fork (something like CollapsableChecklist).

Another note - once something like plotly/dash-renderer#26 is added, this behaviour will be able to be specified with something like:

dcc.CheckList(options=[
    {
        'value': 'melons',
        'label': html.Details([
            html.Summary('Label of the item'),
            html.Div(html.Img(src='...'), html.Div('More about the mango option')
        ])
    }
])

In other words, we'll be able to allow the user to supply any component as the label, not just strings. In this case, the html.Details component hides and shows content but users could supply any type of label: html.H1, html.Img, etc

@Akronix
Copy link
Contributor Author

Akronix commented Nov 2, 2017

Wow, plotly/dash-renderer#26 looks very promising!
And ambitious too. So, until it is done, I'll keep CollapsableChecklist in our "dash components suit: https://github.com/Grasia/grasia-dash-components

@Akronix Akronix closed this Nov 7, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants